--additional fields for client_customer
ALTER TABLE client_customer ADD nCommission NUMERIC (18,2)

--additional fields for item
ALTER TABLE item ADD cCustCode VARCHAR (15) NULL

ALTER TABLE item ADD nMPrice NUMERIC (18,2)
ALTER TABLE item ADD CONSTRAINT [df_item_nMPrice] DEFAULT(0) FOR [nMPrice]

--additional fields for voucher_trade
ALTER TABLE voucher_trade ADD nTaxableBase NUMERIC (18,2) NULL
ALTER TABLE voucher_trade ADD CONSTRAINT [df_voucher_trade_nTaxableBase] DEFAULT (0) FOR [nTaxableBase]

--additional fields for bank
ALTER TABLE bank ADD nRate NUMERIC (18,2) NULL
ALTER TABLE bank ADD CONSTRAINT [df_bank_nRate] DEFAULT (0) FOR [nRate]

--create table commission_customer
/****** Object:  Table [dbo].[commission_customer]    Script Date: 04/23/2010 09:31:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[commission_customer](
	[cCompanyID] [varchar](10) NOT NULL,
	[nIdentity] NUMERIC(18,0) IDENTITY(1,1) NOT NULL,
	[cCode] [varchar] (15) NOT NULL,
	[cType] [varchar] (15) NULL,
	[cItemNo] [varchar](15) NULL,
	[cDescription] [varchar](50) NOT NULL,
	[cBarcode] [varchar] (15) NOT NULL,
	[nSRP] NUMERIC(18,2) NOT NULL,
	[nCommission] NUMERIC(18,2) NOT NULL,
	[nPrice] NUMERIC(18,2) NOT NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE commission_customer ADD CONSTRAINT [df_commission_customer_nSRP] DEFAULT (0) FOR [nSRP]
GO

ALTER TABLE commission_customer ADD CONSTRAINT [df_commission_cusotmer_nCommission] DEFAULT (0) FOR [nCommission]
GO

ALTER TABLE commission_customer ADD CONSTRAINT [df_commission_customer_nPrice] DEFAULT (0) FOR [nPrice]
GO

--create table card_type
/****** Object:  Table [dbo].[card_type]   Script Date: 04/22/2010 10:29:43 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[card_type](
	[cCompanyID] [varchar](10) NOT NULL,
	[cCode] [varchar](10) NOT NULL,
	[cDescription] [varchar](50) NOT NULL,
	[nOrder] numeric (18,0) NULL,
	[nRate] numeric (18,2) NOT NULL
 CONSTRAINT [PK_card_type] PRIMARY KEY CLUSTERED 
(
	[cCompanyID] ASC,
	[cCode] ASC
	
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE card_type ADD CONSTRAINT [df_card_type_nRate] DEFAULT (0) FOR [nRate]


SET ANSI_PADDING OFF
GO